<?php

namespace App;

use App\Models\AdminUser;
use Carbon\Carbon;
use Encore\Admin\Traits\DefaultDatetimeFormat;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @property integer $transverse_id
 * @property float $amount
 * @property string|null|Carbon $pay_date
 * @property  string $remark
 * @property integer $creator_id
 */
class TransverseBill extends Model
{
    use DefaultDatetimeFormat;

    protected $fillable = ['transverse_id', 'amount', 'pay_date', 'remark', 'creator_id'];

    public function transverse(): BelongsTo
    {
        return $this->belongsTo(Transverse::class);
    }

    public function creator()
    {
        return $this->belongsTo(AdminUser::class,'creator_id');
    }

}
